<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/9
 * Time: 13:14
 */

namespace app\common\model;


use think\Model;

class LotteryLol extends Model
{
    protected $name = 'lottery_lol';

    protected $hidden = ['updatetime','game'];
    protected $append = [
        'status_name'
    ];

    public function gamelol()
    {
        return $this->hasOne('GameLol','identifier','result');
    }

    public function getStatusNameAttr($value,$data)
    {
        switch ( $data['status'] ){
            case 0:
                return '待开奖';
                break;
            case 1:
                return '已开奖';
                break;
            case 2:
                return '开奖异常';
                break;
        }
    }

}